package test;

import java.io.File;
import java.io.FileInputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
import java.util.Properties;

public class Property extends Thread {

	public Property() {
		try {
			File file = new File("Z:/kaoyan.txt");
			FileInputStream fis = new FileInputStream(file);
			Properties prop = new Properties();
			prop.load(fis);
			System.out.println(prop.size());
			int i = 0;
			ArrayList<String> list = new ArrayList<String>();
			for (Map.Entry<Object, Object> e : prop.entrySet()) {
				// String value = (String) e.getValue();
				// value = new String(value.getBytes("ISO8859-1"), "GBK");
				// Batch.generateFile((String) e.getKey());
				list.add((String) e.getKey());
				i++;
			}
			Collections.shuffle(list);
			i=0;
			for (String s : list) {
				Batch.generateFile(s);
				System.out.println(i++);
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new Property().start();
		try {
			Thread.sleep(1000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}

	}
}
